package top.suven.base.http.enums;

/**
 * @ClassName: GrantOpenStatusEnumType
 * @Description:
 * @Author aric
 * @Date 2018/7/6 下午4:29
 * @Copyright: (c) 2018 gc by https://www.gc.com.cn/
 * @Version : 1.0.0
 * --------------------------------------------------------
 * modifyer    modifyTime                 comment
 *
 *
 * <p>
 * --------------------------------------------------------
 */
public enum GrantOpenStatusEnumType {
    ON("on","已授权"),OFF("off","未授权");

    String index;
    String name;

    public String getIndex() {
        return index;
    }
    public String getName() {
        return name;
    }

    GrantOpenStatusEnumType(String value, String name) {
        this.index = index;
        this.name = name;
    }

    public static GrantOpenStatusEnumType getByIndex(String index) {
        for(GrantOpenStatusEnumType typeEnum : GrantOpenStatusEnumType.values()) {
            if(typeEnum.index.equals(index)) {
                return typeEnum;
            }
        }
        throw new IllegalArgumentException("No element matches " + index);
    }
}
